﻿// Decompiled with JetBrains decompiler
// Type: Netick.NetickArrayExt
// Assembly: Netick, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 6726ECA1-C773-4CF7-8952-E81B30D93B52
// Assembly location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.dll
// XML documentation location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.xml

using System;

#nullable disable
namespace Netick;

public static class NetickArrayExt
{
  public static NetworkArrayStruct4<T> ToNetworkArrayStruct4<T>(this T[] array) where T : unmanaged
  {
    NetworkArrayStruct4<T> networkArrayStruct4 = new NetworkArrayStruct4<T>();
    int num = Math.Min(4, array.Length);
    for (int i = 0; i < num; ++i)
      networkArrayStruct4[i] = array[i];
    return networkArrayStruct4;
  }

  public static NetworkArrayStruct8<T> ToNetworkArrayStruct8<T>(this T[] array) where T : unmanaged
  {
    NetworkArrayStruct8<T> networkArrayStruct8 = new NetworkArrayStruct8<T>();
    int num = Math.Min(8, array.Length);
    for (int i = 0; i < num; ++i)
      networkArrayStruct8[i] = array[i];
    return networkArrayStruct8;
  }

  public static NetworkArrayStruct16<T> ToNetworkArrayStruct16<T>(this T[] array) where T : unmanaged
  {
    NetworkArrayStruct16<T> networkArrayStruct16 = new NetworkArrayStruct16<T>();
    int num = Math.Min(16 /*0x10*/, array.Length);
    for (int i = 0; i < num; ++i)
      networkArrayStruct16[i] = array[i];
    return networkArrayStruct16;
  }

  public static NetworkArrayStruct32<T> ToNetworkArrayStruct32<T>(this T[] array) where T : unmanaged
  {
    NetworkArrayStruct32<T> networkArrayStruct32 = new NetworkArrayStruct32<T>();
    int num = Math.Min(32 /*0x20*/, array.Length);
    for (int i = 0; i < num; ++i)
      networkArrayStruct32[i] = array[i];
    return networkArrayStruct32;
  }

  public static NetworkArrayStruct64<T> ToNetworkArrayStruct64<T>(this T[] array) where T : unmanaged
  {
    NetworkArrayStruct64<T> networkArrayStruct64 = new NetworkArrayStruct64<T>();
    int num = Math.Min(64 /*0x40*/, array.Length);
    for (int i = 0; i < num; ++i)
      networkArrayStruct64[i] = array[i];
    return networkArrayStruct64;
  }
}
